package net.omegachess.controllers
{
	import mx.collections.ArrayCollection;
	import mx.core.Container;
	import mx.core.IFlexDisplayObject;
	import mx.utils.ObjectUtil;
	
	import net.omegachess.classes.Board;
	import net.omegachess.events.CellSelectedEvent;
	import net.omegachess.events.MoveAcceptedEvent;

	public class GameController extends Object
	{
		public var screenDisplay : Container;
		public var boardDisplay : Container;
		
		public var board : Board;
		
		private var moveHistory : ArrayCollection = new ArrayCollection();
		
		public function GameController() {
			super();
		}
		
		public function init() : void {
			trace("INIT");
			board = new Board(boardDisplay);
			board.draw();
			
			board.addEventListener(CellSelectedEvent.CELL_SELECTED, handleCellSelected);
		}
		
		public function handleCellSelected( event : CellSelectedEvent ) : void {
			
		}
		
		public function moveHandler( event : MoveAcceptedEvent ) : void {
			
			trace("In movehandler");					
			
			
			/*for each(var move : String in moveHistory) {
				trace(move);
			}*/
		}
	}
}